//package cqrtplm.service.impl;
//
//import cn.hutool.core.collection.CollUtil;
//import com.alibaba.nacos.common.utils.StringUtils;
//import com.hustcad.plm.pdm.iba.model.dto.IBASaveParamDTO;
//import com.hustcad.plm.pdm.iba.model.dto.SaveObjIBADTO;
//import com.hustcad.plm.pdm.iba.service.TyplmCommonAttributeService;
//import com.hustcad.plm.pdm.iba.service.impl.TyplmAttributeValueServiceImpl;
//import com.ty.basic.entity.IdentifierEntity;
//import com.ty.basic.exception.MessageException;
//import com.ty.basic.handler.exceptionhandler.exception.ResponseCodeEnum;
//import liquibase.repackaged.org.apache.commons.lang3.ObjectUtils;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.collections4.CollectionUtils;
//import org.springframework.context.annotation.Primary;
//import org.springframework.stereotype.Service;
//
//import javax.annotation.Resource;
//import java.math.BigInteger;
//import java.util.*;
//
//@Primary
//@Service
//@Slf4j
//public class RTTyplmAttributeValueServiceImpl extends TyplmAttributeValueServiceImpl {
//    @Resource
//    private TyplmCommonAttributeService typlmCommonAttributeService;
//
//    /**
//     * 跳过枚举值校验
//     * @param objWithIbaList
//     * @param oidAndNumNameMap
//     * @param partusageoidAndMasterOid
//     * @param exceptions
//     * @param isCreat
//     */
//    @Override
//    public void batchSaveIBAByObjList(List<SaveObjIBADTO> objWithIbaList, Map<BigInteger, String> oidAndNumNameMap, Map<BigInteger, BigInteger> partusageoidAndMasterOid, List<Map<ResponseCodeEnum, String[]>> exceptions, boolean isCreat) {
//        List<IBASaveParamDTO> ibaSaveParamDTOList = this.batchBuildIBAByObjList(objWithIbaList, isCreat);
//        this.batchSaveAttributeValueForImport(ibaSaveParamDTOList, oidAndNumNameMap, partusageoidAndMasterOid, exceptions);
//    }
//
//    private void batchSaveAttributeValueForImport(List<IBASaveParamDTO> ibaSaveParamDTOList, Map<BigInteger, String> oidAndNumNameMap, Map<BigInteger, BigInteger> partusageoidAndMasterOid, List<Map<ResponseCodeEnum, String[]>> exceptions) {
//        if (!CollectionUtils.isEmpty(ibaSaveParamDTOList)) {
//            Map<IdentifierEntity, List<MessageException>> errorMap = this.typlmCommonAttributeService.batchSaveAttributeValueForException(ibaSaveParamDTOList);
//            if (!org.springframework.util.CollectionUtils.isEmpty(errorMap)) {
//                String partNumAndName = null;
//                Iterator<Map.Entry<IdentifierEntity, List<MessageException>>> var7 = errorMap.entrySet().iterator();
//
//                while(true) {
//                    List<MessageException> value;
//                    do {
//                        if (!var7.hasNext()) {
//                            if (partNumAndName == null && CollUtil.isNotEmpty(errorMap.values())) {
//                                List<MessageException> errorList = new ArrayList<>();
//                                errorMap.values().forEach(errorList::addAll);
//                                throw new MessageException(errorList);
//                            }
//
//                            return;
//                        }
//
//                        Map.Entry<IdentifierEntity, List<MessageException>> messageExceptionEntry = (Map.Entry)var7.next();
//                        IdentifierEntity identifierEntity = messageExceptionEntry.getKey();
//                        value = messageExceptionEntry.getValue();
//                        BigInteger oid;
//                        if (ObjectUtils.isNotEmpty(identifierEntity) && CollUtil.isNotEmpty(oidAndNumNameMap)) {
//                            oid = identifierEntity.getOid();
//                            partNumAndName = oidAndNumNameMap.get(oid);
//                        }
//
//                        if (partNumAndName == null && ObjectUtils.isNotEmpty(identifierEntity) && CollUtil.isNotEmpty(partusageoidAndMasterOid) && CollUtil.isNotEmpty(oidAndNumNameMap)) {
//                            oid = identifierEntity.getOid();
//                            String otype = identifierEntity.getOtype();
//                            if (oid != null && "ty.inteplm.part.CTyPartUsageLink".equalsIgnoreCase(otype)) {
//                                BigInteger masterOid = partusageoidAndMasterOid.get(oid);
//                                if (masterOid != null) {
//                                    partNumAndName = oidAndNumNameMap.get(masterOid);
//                                }
//                            }
//                        }
//                    } while(partNumAndName == null);
//
//                    EnumMap<ResponseCodeEnum, String[]> moodMap = new EnumMap<>(ResponseCodeEnum.class);
//                    StringJoiner msgJoiner = new StringJoiner(";");
//                    Iterator<MessageException> var18 = value.iterator();
//
//                    while(var18.hasNext()) {
//                        MessageException messageException = var18.next();
//                        if (messageException != null && StringUtils.isNotEmpty(messageException.getMessage())) {
//                            msgJoiner.add(messageException.getMessage());
//                        }
//                    }
//
////                    moodMap.put(ResponseCodeEnum.BATCH_SAVE_IBA_EXCEPTION_BOM, new String[]{partNumAndName, msgJoiner.toString()});
//                    exceptions.add(moodMap);
//                }
//            }
//        }
//    }
//}
